/**
 * Copyright © 2014 Creativor Studio.
 * About license information, please see LICENSE.txt.
 */
package org.rayson.api;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import org.rayson.api.annotation.NotNull;
import org.rayson.api.annotation.ThreadSafe;

/**
 * TODO Add type description here.
 *
 * @author creativor
 */
@ThreadSafe(false)
public class KeyValues {

	private final Map<String, String> values;

	public KeyValues() {
		values = new HashMap<String, String>();
	}

	public boolean contains(@NotNull final String key) {
		return values.containsKey(key);
	}

	/**
	 * @return Unmodified entry set.
	 */
	public Set<Entry<String, String>> entrySet() {
		return Collections.unmodifiableSet(values.entrySet());
	}

	public String get(@NotNull final String key) {
		return values.get(key);
	}

	public boolean isEmpty() {
		return values.isEmpty();
	}

	public String put(@NotNull final String key, final String value) {
		return values.put(key, value);
	}

	public int size() {
		return values.size();
	}

	@Override
	public String toString() {
		return values.toString();
	}
}
